<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Url Filter Shiro Access Demo</title>
    <script type="text/javascript" src="${ctxStatic}/js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#loginbtn").click(function(){
                setTimeout("login()", 1500);
            });
        });

        function login(){
            var form = $("#loginform");
            url = form.attr("action");

            $.ajax({
                url:url,
                data:form.serialize(),
                type:'post',
                success:function(data){
                    //取消加载信息.......
                    if(data.code == 200){
                        window.location.href="";
                    }else {
                        alert(data.message);
                    }
                },
                dataType:'json'
            });
        }
    </script>

</head>
<body>
    <form method="post" id="loginform" action="${ctx}/user/login" onsubmit="return false;">
        <dl>
            <dt>用户名：</dt>
            <dd><input type="text" name="username" id="account" value="jianguo"/></dd>
        </dl>
        <dl>
            <dt>密  码：</dt>
            <dd><input type="password" name="password" id="password" value="123456"/></dd>
        </dl>
        <dl class="special">
            <dt></dt>
            <dd><button id="loginbtn"></button></dd>
        </dl>
    </form>
</body>
</html>